package com.docker.sys.menu;

import com.docker.core.constant.MainConstant;
import com.docker.core.mvc.dao.BaseDao;
import com.jfinal.plugin.activerecord.Record;

/**
 * @Author ldl
 * @Create 2020/09/18 018 10:01
 */
public class MenuDao extends BaseDao {

    @Override
    protected String getDbName() {
        return MainConstant.DB_DOCKER;
    }

    @Override
    protected String getSqlTplNameSpace() {
        return "sys.menu";
    }

    public int pLevel(String menuPid) {
        return tplQueryInt("parent.level", menuPid);
    }

    public boolean save(Record menu) {
        return save("sys_menu", "menu_id", menu);
    }

    public Record info(String menuId) {
        return info("sys_menu", "menu_id", menuId);
    }

    public boolean update(Record menu) {
        return update("sys_menu", "menu_id", menu);
    }

}
